import java.util.Arrays;

public class Test {

    /**
     * 将数组扩大2倍  不是在源数组上进行修改
     * @param array
     * @return
     */
    public static int[] transform1(int[] array) {
        int[] tmp = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            tmp[i] = 2*array[i];
        }
        return tmp;
    }

    public static void transform(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] = 2*array[i];
        }
    }

    public int[] twoSum(int[] nums, int target) {
        int[] ret = {-1,-1};
        for(int i = 0;i < nums.length;i++) {
            for(int j = i+1;j < nums.length;j++) {
                if(nums[i] + nums[j] == target) {
                    ret[0] = i;
                    ret[1] = j;
                    return ret;
                }
            }
        }
        return ret;
    }

    public static boolean isUp(int[] array) {
        for (int i = 0; i < array.length-1; i++) {
            if(array[i] > array[i+1]) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int[] array = {1,2,3};
        System.out.println(isUp(array));
       /* transform(array);
        System.out.println(Arrays.toString(array));

        int[] array2 = new int[100];
        for (int i = 0; i < array2.length; i++) {
            array2[i] = i+1;
        }
        System.out.println(Arrays.toString(array2));*/
    }
}
